package cc.mrbird.febs.api;

import cc.mrbird.febs.common.entity.FebsResponse;
import cc.mrbird.febs.customer.entity.Share;
import cc.mrbird.febs.customer.service.IShareService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ Author 马超伟
 * @ Date 2020-11-04 17:30
 * @ Description:
 * @ Version:
 */
@RestController
@RequestMapping("/api/share")
public class shareApiController {

    @Resource
    private IShareService shareService;

    /**
     * @ Author: 马超伟
     * @ Date: 2020/11/4 17:45
     * @ Params: []
     * @ return: cc.mrbird.febs.common.entity.FebsResponse
     * @ Description: 分享接口
     */
    @RequestMapping("/getShare")
    public FebsResponse getShare(String activity){
        Share share = shareService.getOne(new QueryWrapper<Share>().lambda().eq(Share::getActivityId, activity), false);
        return new FebsResponse().success().put("share",share);
    }


}
